package com.com.cgq.data.exchenge;


import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;

/**
 * Created by cgq on 2015/11/2.
 */
public class SettingDataToFile  {

    private  boolean mbIsCanLeftDrag;
    private  boolean mbIsShowViewPage;
    private Context mContext;
    private SharedPreferences   mSharedPreferences;
    private SharedPreferences.Editor editor;

    public SettingDataToFile(Context context) {
        mContext = context;
        initData();
    }


    public  void initData() {
        mbIsCanLeftDrag = false;
        mbIsShowViewPage = false;
        mSharedPreferences = mContext.getSharedPreferences("Setting",  Activity.MODE_WORLD_WRITEABLE);
        editor = mSharedPreferences.edit();//获取编辑器
    }




    public  boolean getIscanLeftDrag() {
        mbIsCanLeftDrag =  mSharedPreferences.getBoolean("bIsCanleftDrag", false);
        return mbIsCanLeftDrag;
    }

    public  void setIscanLeftDrag(boolean bIsCanLeftDrag) {
        mbIsCanLeftDrag = bIsCanLeftDrag;
        editor.putBoolean("bIsCanleftDrag", bIsCanLeftDrag);
        editor.commit();
    }

    public  boolean getIsShowViewPage() {
        mbIsShowViewPage =  mSharedPreferences.getBoolean("bIsShowViewPage", false);
        return mbIsShowViewPage;
    }

    public  void setIsShowViewPage(boolean bIsShowViewPage) {
        mbIsShowViewPage = bIsShowViewPage;
        editor.putBoolean("bIsShowViewPage", bIsShowViewPage);
        editor.commit();
    }
}
